
public class Player {
private String name;
private int damage;
private int accuracy;
public Player(String name, int damage, int accuracy)
{
	this.name=name;
	this.damage=damage;
	this.accuracy= accuracy;
}


public int attack()
{
	int randomDamage = 1 + (int)(Math.random() * 4);  //This creates a random number between 1 and 4
	int totalDamage=randomDamage * damage; //final calculation for total damage, damage multiplier times random damage
	int randomAccuracy = (1+(int)(Math.random() * 10)); //This creates a random number between 1 and 10

	if(randomAccuracy <= accuracy)  //If the randomAccuracy is less than player accuracy, the player misses
		return totalDamage;
	else
		return 0;

}
public int heavyAttack()
{
	int randomDamage = 5 + (int)(Math.random() * 3);  //This creates a random number between 1 and 4
	int totalDamage=randomDamage * damage; //final calculation for total damage, damage multiplier times random damage
	int randomAccuracy = (1+(int)(Math.random() * 11)); //This creates a random number between 1 and 10

	if(randomAccuracy <= accuracy)  //If the randomAccuracy is less than player accuracy, the player misses
		return totalDamage;
	else
		return 0;
}
}
